<extend name="Base:main" />
<block name="script">
<script src="__PUBLIC__/seller/js/echarts.min.js"></script>
</block>
<block name="content">
	<div class="tpl-content-wrapper">
		<div class="tpl-content-page-title">
			欢迎【{$login_info.shop_name}】登录
		</div>
		<ol class="am-breadcrumb">
			<li><a href="#" class="am-icon-home">首页</a></li>
			<li><a href="#">欢迎</a></li>
			<li class="am-active">数据统计</li>
		</ol>
		<eq name="warehouse" value="0">
		<div class="tpl-content-scope">
			<div class="error_tips">警告：您还未创建仓库，请立即去创建！快速创建通道-><a href="{:U('Warehouse/add')}">立即创建仓库</a></div>
		</div>
		</eq>
		<eq name="dispatching" value="0">
		<div class="tpl-content-scope">
			<div class="error_tips">警告：您还未物流配送模板，请立即去创建！快速创建通道-><a href="{:U('Dispatching/add')}">立即创建配送模板</a></div>
		</div>
		</eq>
		<div class="tpl-content-scope">
			<div class="note note-info">
				<p>等级：<?php if( $login_info['grade_data'] ) { echo $login_info['grade_data']['name']; } else { echo "无等级"; } ?>，登录次数：{$login_info['login_num']}，总经验：{$login_info.empirical}<?php if( $login_info['last_login_time'] > 0 ) : ?>，上次登录时间：{:date('Y-m-d H:i:s' , $login_info['last_login_time'])}，上次登录IP：{$login_info['last_login_ip']}<?php endif; ?></p>
			</div>
		</div>
		<style>
			.data_count_s{ background:#fff; width:100%; padding:20px 0px; }
			.data_count_s ul{ width:50%; float:left; }
			.data_count_s ul li{ float:left }
			.data_count_s ul li.title{ width:30%;  text-indent:2em;}
			.data_count_s ul li.num{ width:70%; }
		</style>
		<div class="row">
			<div class="am-u-sm-12">
				<div class="dashboard-stat">
					<div class="data_count_s">
						<ul>
							<li class="title">库存预警：</li>
							<li class="num"><a href="{:U('Goods/supplyGoodsList',array('status' => 2))}">{$notice_total_goods}</a></li>
						</ul>
						<ul>
							<li class="title">临期锁货：</li>
							<li class="num"><a href="{:U('Goods/distribution',array('type'=>'lock','status' => 4))}">{$advent_total_goods}</a></li>
						</ul>
						<div style="clear:both"></div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="am-u-lg-2 am-u-md-6 am-u-sm-12">
				<div class="dashboard-stat blue">
					<div class="visual">
						<i class="am-icon-comments-o"></i>
					</div>
					<div class="details">
						<div class="number"> {$fx_goods_total} </div>
						<div class="desc"> 分销商品总数 </div>
					</div>
					<a class="more" href="{:U('Goods/distribution')}">查看更多
				<i class="m-icon-swapright m-icon-white"></i>
			</a>
				</div>
			</div>
			<div class="am-u-lg-2 am-u-md-6 am-u-sm-12">
				<div class="dashboard-stat blue">
					<div class="visual">
						<i class="am-icon-comments-o"></i>
					</div>
					<div class="details">
						<div class="number"> {$gh_goods_total} </div>
						<div class="desc"> 供应商品总数 </div>
					</div>
					<a class="more" href="{:U('Goods/supplyGoodsList')}">查看更多
				<i class="m-icon-swapright m-icon-white"></i>
			</a>
				</div>
			</div>
			<div class="am-u-lg-2 am-u-md-6 am-u-sm-12">
				<div class="dashboard-stat blue">
					<div class="visual">
						<i class="am-icon-comments-o"></i>
					</div>
					<div class="details">
						<div class="number"> {$fx_order_total} </div>
						<div class="desc"> 分销订单总数 </div>
					</div>
					<a class="more" href="{:U('Goods/distribution' , array('type' => 'distribution'))}">查看更多
				<i class="m-icon-swapright m-icon-white"></i>
			</a>
				</div>
			</div>
			<div class="am-u-lg-2 am-u-md-6 am-u-sm-12">
				<div class="dashboard-stat red">
					<div class="visual">
						<i class="am-icon-bar-chart-o"></i>
					</div>
					<div class="details">
						<div class="number"> {$fx_price_total} </div>
						<div class="desc"> 分销订单总额 </div>
					</div>
					<a class="more" href="{:U('Goods/distribution' , array('type' => 'distribution'))}"> 查看更多
				<i class="m-icon-swapright m-icon-white"></i>
			</a>
				</div>
			</div>
			<div class="am-u-lg-2 am-u-md-6 am-u-sm-12">
				<div class="dashboard-stat green">
					<div class="visual">
						<i class="am-icon-apple"></i>
					</div>
					<div class="details">
						<div class="number">{$gh_order_total} </div>
						<div class="desc"> 供货订单总数 </div>
					</div>
					<a class="more" href="{:U('Goods/supplyGoodsList')}"> 查看更多
				<i class="m-icon-swapright m-icon-white"></i>
			</a>
				</div>
			</div>
			<div class="am-u-lg-2 am-u-md-6 am-u-sm-12">
				<div class="dashboard-stat purple">
					<div class="visual">
						<i class="am-icon-android"></i>
					</div>
					<div class="details">
						<div class="number"> {$gh_price_total} </div>
						<div class="desc"> 供货订单总金额 </div>
					</div>
					<a class="more" href="{:U('Goods/supplyGoodsList')}"> 查看更多
				<i class="m-icon-swapright m-icon-white"></i>
			</a>
				</div>
			</div>



		</div>

		<div class="row">
			<div class="am-u-md-6 am-u-sm-12 row-mb">
				<div class="tpl-portlet">
					<div class="tpl-portlet-title">
						<div class="tpl-caption font-red ">
							<i class="am-icon-bar-chart"></i>
							<span>最新订单</span>
						</div>
						<div class="actions">
							<a href="{:U('Order/distributionList')}" >更多</a>
						</div>
					</div>
					<div class="tpl-scrollable">
						<div class="number-stats" style="paddingp-top:10px;">
						</div>
						<table class="am-table tpl-table">
							<thead>
								<tr class="tpl-table-uppercase">
									<th>状态</th>
									<th>订单编号</th>
									<th>来源平台</th>
									<th>订单总额</th>
									<th>供应商</th>
									<th>是否支付</th>
									<th>是否发货</th>
								</tr>
							</thead>
							<tbody>
								<volist name="order_list" id="vo">
								<tr>
									<td><?php if( !$vo['status'] ) { ?>未确认<?php } else if( $vo['status'] == 1) { echo "已确认"; } else { echo "失效"; } ?></td>
									<td><a href="{:U('Order/detail' , array('ref' => $vo['ref']))}">{$vo.ref}</a></td>
									<td><empty name="vo.name">平台下单<else />{$vo.name}</empty></td>
									<td>{$vo.amount_total}</td>
									<td>{$vo.shop_name}</td>
									<td><?php if( !$vo['pay_status'] ) { echo "未支付"; } else if( $vo['pay_status'] == 1 ) { echo "一部分"; } else { echo "全部支付"; } ?></td>
									<td><?php if( !$vo['express_send_status'] ) { echo "未发货"; } else if( $vo['express_send_status'] == 1 ) { echo "一部分"; } else { echo "全部发货"; } ?></td>
								</tr>
								</volist>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="am-u-md-6 am-u-sm-12 row-mb">
				<div class="tpl-portlet">
					<div class="tpl-portlet-title">
						<div class="tpl-caption font-red ">
							<i class="am-icon-bar-chart"></i>
							<span>最新供应清单</span>
						</div>
						<div class="actions">
							<a href="{:U('Goods/supplyGoodsList')}" >更多</a>
						</div>
					</div>
					<div class="tpl-scrollable">
						<div class="number-stats" style="paddingp-top:10px;">
						</div>
						<table class="am-table tpl-table">
							<thead>
								<tr class="tpl-table-uppercase">
									<th>商品名称</th>
									<th>EN13码</th>
									<th>代发价</th>
									<th>锁货价 / 最低量</th>
									<th>批发价 / 最低量</th>
									<th>库存</th>
									<th>状态</th>
								</tr>
							</thead>
							<tbody>
								<volist name="supply_list" id="vo">
								<tr>
									<td>{:mb_substr($vo['name'] , 0 , 13, 'utf-8')}</td>
									<td>{$vo.earn13}</td>
									<td>{$vo.acting_price}</td>
									<td>{$vo.lock_price} / {$vo.lock_start_num}</td>
									<td>{$vo.wholesale_price} / {$vo.wholesale_start_num}</td>
									<td>{$vo.stock_num}</td>
									<td>
                                    	<switch name="vo.status">
                                        	<case value="0">未审核</case>
                                        	<case value="1">审核失败</case>
                                        	<case value="2">审核通过</case>
                                        	<case value="3">已过期</case>
                                        </switch>
                                    </td>
								</tr>
								</volist>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		
	</div>
</block>